home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 1995 May / PC Answers CD-ROM 7 (Future Publishing) (May 1995).iso / vbits / code / cert / trk3_eg / prgtest / frmrvw.frm (.txt) next >
Encoding:
Visual Basic Form  |  1994-11-29  |  3.4 KB  |  113 lines

  1. VERSION 2.00
  2. Begin Form frmReview 
  3.    AutoRedraw      =   -1  'True
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "Review"
  6.    ClientHeight    =   6885
  7.    ClientLeft      =   270
  8.    ClientTop       =   330
  9.    ClientWidth     =   9525
  10.    ControlBox      =   0   'False
  11.    Height          =   7290
  12.    Left            =   210
  13.    LinkTopic       =   "Form2"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   6885
  17.    ScaleWidth      =   9525
  18.    Top             =   -15
  19.    Width           =   9645
  20.    Begin MaskEdBox mskNo 
  21.       Height          =   375
  22.       Left            =   600
  23.       Mask            =   "###"
  24.       MaxLength       =   3
  25.       PromptChar      =   "_"
  26.       TabIndex        =   0
  27.       Top             =   5880
  28.       Width           =   975
  29.    End
  30.    Begin CommandButton cmdGoto 
  31.       Caption         =   "&Goto"
  32.       Height          =   495
  33.       Left            =   2040
  34.       TabIndex        =   4
  35.       Top             =   5760
  36.       Width           =   1695
  37.    End
  38.    Begin CommandButton cmdMark 
  39.       Caption         =   "Review &Marked Questions"
  40.       Height          =   495
  41.       Left            =   4800
  42.       TabIndex        =   2
  43.       Top             =   5760
  44.       Width           =   2415
  45.    End
  46.    Begin CommandButton cmdEnd 
  47.       Caption         =   "&End Test"
  48.       Height          =   495
  49.       Left            =   7920
  50.       TabIndex        =   1
  51.       Top             =   5760
  52.       Width           =   1215
  53.    End
  54.    Begin Label lblNo 
  55.       Caption         =   "Review Question No."
  56.       Height          =   495
  57.       Left            =   600
  58.       TabIndex        =   3
  59.       Top             =   5280
  60.       Width           =   1215
  61.    End
  62.    Begin Line Line1 
  63.       X1              =   0
  64.       X2              =   9480
  65.       Y1              =   5040
  66.       Y2              =   5040
  67.    End
  68. Option Explicit
  69. Sub cmdEnd_Click ()
  70. Dim ret As Long
  71. Dim rc As Integer
  72. If cmdEnd.Caption = "E&xit Test" Then
  73.     Unload frmQuestion
  74.     Unload Me
  75.     End
  76.     rc = MsgBox("This will end the test. Are you sure you would like to end the test.", 4 + 32, "Test Ending")
  77.     If rc = 6 Then
  78.         cmdEnd.Caption = "E&xit Test"
  79.         Answers = True
  80.         Call ShowReview
  81.         frmQuestion.mskCorrect.Visible = True
  82.         frmQuestion.lblCorrect.Visible = True
  83.         frmQuestion.mskCorrect.Mask = ""
  84.         frmQuestion.mskAnswer.Mask = ""
  85.         ret& = SendMessage(frmQuestion.mskCorrect.hWnd, EM_SETREADONLY, True, 0&)
  86.         ret& = SendMessage(frmQuestion.mskAnswer.hWnd, EM_SETREADONLY, True, 0&)
  87.     Else
  88.         MsgBox "The test will continue."
  89.         frmQuestion.Data1.ReadOnly = True
  90.     End If
  91. End If
  92. End Sub
  93. Sub cmdGoto_Click ()
  94. Dim bk As String
  95. Dim quote As String
  96. Dim MyCriteria As String
  97. quote = Chr$(34)
  98. bk = frmQuestion.Data1.Recordset.Bookmark
  99. frmQuestion.Data1.Recordset.MoveFirst
  100. MyCriteria = "QUid = " & Val(Trim(mskNo.ClipText))
  101. frmQuestion.Data1.Recordset.FindFirst MyCriteria
  102. If frmQuestion.Data1.Recordset.NoMatch Then
  103.     MsgBox "That question number could not be found."
  104.     frmQuestion.Data1.Recordset.Bookmark = bk
  105.     frmQuestion.Show
  106. End If
  107. End Sub
  108. Sub cmdMark_Click ()
  109. frmQuestion.Data1.RecordSource = "Select * from testData where Mark = True"
  110. frmQuestion.Data1.Refresh
  111. frmQuestion.Show
  112. End Sub
  113.